package com.cbw.firegame.member.vo;

import lombok.Data;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@ToString
@Data
public class RegistVo {
    @NotEmpty(message = "用户名必须提交")
    @Length(min = 3,max = 18,message = "用户名必须是3-18个字符")
    private String username;

    @NotEmpty(message = "用户名必须填写")
    @Length(min = 6,max = 10,message = "密码必须是6-10位")
    private String password;

    private String sex;


    @NotEmpty(message = "手机号必须填写")
    @Pattern(regexp = "^(0|86|17951)?(13[0-9]|15[012356789]|17[3678]|18[0-9]|14[57])[0-9]{8}$",message = "手机号格式不正确")
    private String phone;

    @NotEmpty(message = "邮箱必须填写")
    @Pattern(regexp = "^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$",
    message = "请输入正确的邮箱")
    private String email;


    @NotEmpty(message = "验证码不能为空")
    private String yzm;
}
